import Vue from 'vue'
// 引入路由
import VueRouter from 'vue-router'
// 引入vue-resource
import VueResource from 'vue-resource'
import App from './App.vue'
import Home from './components/Home.vue'
import HelloWorld from './components/HelloWorld.vue'
Vue.config.productionTip = false
// 使用路由
Vue.use(VueRouter)
// 使用vue-resource
Vue.use(VueResource)
// 配置路由
const router=new VueRouter({
  routes:[
    {path:"/",component:Home},//单斜杆代表根路径，我们可以指定跳转到某个组件
    {path:"/helloworld",component:HelloWorld},//让跳转到helloworld组件中
  ],
  mode:"history"
})
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
